import { request } from 'ngfe-request'

// 积分规则列表查询
export async function getPointRuleList(params: any) {
  return request('/list', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'PointRuleSVC',
        stdIntfcInd: 'list',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    }
  })
}

// 验证积分规则编号是否重复
export async function checkCode(params: any) {
  return request('/checkCode', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'PointRuleSVC',
        stdIntfcInd: 'checkCode',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    }
  })
}


// 积分规则添加
export async function pointRuleListAdd(params: any) {
  return request('/save', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'PointRuleSVC',
        stdIntfcInd: 'save',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    }
  })
}

// 积分规则失效
export async function pointRuleDisable(params: any) {
  return request('/disable', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'PointRuleSVC',
        stdIntfcInd: 'disable',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    }
  })
}